<template>
    <h2>管理员查看查看投资项目列表</h2>
<inverstshow v-slot="info">
    <a href="#" @click="shan(info.id)">删除</a>
</inverstshow>
</template>
<script setup lang="ts">
import inverstshow from './inverstshow.vue'
import axios from 'axios'
const shan=(id:number)=>{
    axios({
        url:"https://localhost:44394/api/InverstController/Dele",
        params:{id:id},
        method:"delete"
    })
    .then(res=>{
        if(res.data==-1){
            alert('有人投资，不能删除')
            return
        }
        if(res.data>0){
            alert('删除成功')
            location.href='ginverstshow'
        }
         else{
            alert('删除失败')
        }
    })
}
</script>